public class Test25 {
    public static void main(String[] args) {
        BankAccount b = new BankAccount("张三", "1001", 200);
        b.setBalance(b.getBalance() + 100);
        System.out.println(b);
    }
}

class BankAccount {
    private String username;;

    private String number;

    private float balance;

    public BankAccount() {
        this(" ", " ", 0);
    }

    public BankAccount(String username, String number, float balance) {
        this.username = username;
        this.number = number;
        this.balance = balance;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public float getBalance() {
        return balance;
    }

    public void setBalance(float balance) {
        this.balance = balance;
    }

    public float deposit(float amount) {//存款
        return this.getBalance() + amount;
    }

    public float withdraw(float amount) {
        if (amount >= this.getBalance()) {
            System.out.println("余额不足\n");
            return this.getBalance();
        } else {
            return this.getBalance() - amount;
        }
    }

    @Override
    public String toString() {
        return "账号: " + this.getNumber() + ", 余额: " + this.getBalance();
    }
}